//
//  huiyishiTableViewController.m
//  shuilijuOASystem
//
//  Created by michael on 16/8/10.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "huiyishiTableViewController.h"
#import "PickerChoiceView.h"
#import "selectview.h"
#import "GDataDefines.h"
@interface huiyishiTableViewController ()<CustomDatePickerDelegate,TFPickerDelegate>
 


@property (strong, nonatomic)UIButton * databutton;
@property (strong, nonatomic)UIButton * databutton2;
@property (strong, nonatomic)UIButton * placebutton;
@property (strong, nonatomic)UIButton * button1;
@property (strong, nonatomic)UIButton * button2;
@property (strong, nonatomic)  UITextView *dayField;
@property (strong, nonatomic)  UITextView *workField;
@property (strong, nonatomic)  UITextView *peopleField;
@property (strong, nonatomic)  UITextView *danweiField;
@property (strong, nonatomic)  UITextView *lianxiField;
@property (strong, nonatomic)  UITextView *beizhuField;
@property (strong, nonatomic)  UITextView *phoneField;

@property (strong, nonatomic)  UITextView *shenqingField;
@property (strong, nonatomic)selectview * selectview;

@property (nonatomic,copy)NSString *startime;
@property (nonatomic,copy)NSString *endtime;
@property (nonatomic,copy)NSString *daystring;


@property (strong, nonatomic)NSArray *array;

@end

@implementation huiyishiTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"申请会议";
     NSDate *currentDate = [NSDate date];//获取当前时间，日期
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd"];
_date = [dateFormatter stringFromDate:currentDate];
    _customPicker = [[CustomDatePicker alloc] init];
    _customPicker.backgroundColor = [UIColor whiteColor];
    _customPicker.delegate = self;
    [self.view addSubview:_customPicker];
    
    _customPicker2 = [[CustomDatePicker alloc] init];
    _customPicker2.backgroundColor = [UIColor whiteColor];
    _customPicker2.delegate = self;
    [self.view addSubview:_customPicker2];
    [_customPicker SetDatePickerMode:UIDatePickerModeTime withDateFormatterStr:@"HH:mm"];
    [_customPicker2 SetDatePickerMode:UIDatePickerModeTime withDateFormatterStr:@"HH:mm"];
      //点击手势
 UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(keybordDown)];
    [self.view addGestureRecognizer:tap];
[self  loaddata];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    
     UIBarButtonItem * rightIem = [[UIBarButtonItem alloc] initWithTitle:@"发布" style:UIBarButtonItemStylePlain target:self action:@selector(searchAction)];
        self.navigationItem.rightBarButtonItem = rightIem;
}

- (void)searchAction{

if (_datestring==nil) {
    [self.view makeToast:@"请选择会议日期"];
}
if (_startime==nil) {
    [self.view makeToast:@"请选择开始时间"];
}
if (_endtime==nil) {
    [self.view makeToast:@"请选择结束时间"];
}
NSString *huiyi = _workField.text;

huiyi = [huiyi getnewstring];
if ([huiyi length]==0){

[self.view makeToast:@"请填写会议名称"];
}
if (_placestring==nil){
[self.view makeToast:@"请选择会议地点"];

}
NSString *people = _peopleField.text;

people = [people getnewstring];
if ([people length]==0){
[self.view makeToast:@"请填写主持人"];

}
if(_dayField.text ==nil){

[self.view makeToast:@"请填写人数"];

}
NSString *danwei = _danweiField.text;

danwei = [danwei getnewstring];
if([danwei length]==0){

[self.view makeToast:@"请填写承办处室"];

}
NSString *lianxi = _lianxiField.text;

lianxi = [lianxi getnewstring];

if([lianxi length]==0){

[self.view makeToast:@"请填写联系人"];

}
NSString *str = _beizhuField.text;
//str = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; //去除掉首尾的空白字符和换行字符
//str = [str stringByReplacingOccurrencesOfString:@"\r" withString:@""];
//str = [str stringByReplacingOccurrencesOfString:@"\n" withString:@""];
str = [str getnewstring];
if([str length]==0){

[self.view makeToast:@"请填写备注"];

}
NSString *phone = _phoneField.text;

phone = [phone getnewstring];

if([phone length] ==0){

[self.view makeToast:@"请填写电话号码"];

}
if ([_selectview.orderString isEqualToString:@"0"]) {
    _daystring = @"上午";
}else{
  _daystring = @"下午";


}
if (_datestring!=nil&&_startime!=nil&&_endtime!=nil&&[huiyi length]!=0&&_placestring!=nil&&_dayField.text !=nil&&[danwei length]!=0&&([lianxi length]!=0)&&[str length]!=0&&([phone length] !=0)) {
    NSString * userId = [[NSUserDefaults standardUserDefaults]objectForKey:@"userId"];
   NSString *json =[NSString stringWithFormat: @"{'StartDate':'%@','datekind':'%@','StartTime':'%@','endTime':'%@','Subject':'%@','Room':'%@','Chairman':'%@','hyrs':'%@','createtime':'%@','Department':'%@','PhoneNo':'%@','Applyer':'%@','memo':'%@',}",_datestring,_daystring,_startime,_endtime,huiyi,_placestring,people,_dayField.text,_date,danwei,phone,lianxi,str];


    NSArray * array = @[@{@"json":json},@{@"userId":userId}];
           [HttpTools postWithURL:kexchlogistics
     arrays:array method:@"saveMeet" success:^(id JSON) {
     NSData * data = [JSON dataUsingEncoding:NSUTF8StringEncoding];
       GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData: data options:0 error:nil];
         GDataXMLElement *rootElement = [doc rootElement];
    NSArray *users = [rootElement children];
     NSArray *infoData= [rootElement elementsForName:@"info"];
    for (int i = 0;i<[infoData count];i++)
    {
        GDataXMLElement *infoElement = [infoData objectAtIndex:i];
        self.infoString = [infoElement stringValue];
    }


     if ([_infoString isEqualToString:@"1"]) {
     [self.view makeToast:@"发送成功!"];
     [self .navigationController popViewControllerAnimated:YES];
}else{
 [self.view makeToast:@"发送失败!"];
      }
      
    } failure:^(NSError *error) {
        
    }];

}





  

}


- (void)loaddata{

 NSString * userId = [[NSUserDefaults standardUserDefaults]objectForKey:@"userId"];
    NSArray * array = @[@{@"userId":userId}];
           [HttpTools requestWithURL:kexchlogistics
     arrays:array method:@"getCreateInfo" success:^(id JSON) {
     
     NSString *string = JSON[@"room"];
     _array = [string componentsSeparatedByString:@","];
     
           [self.tableView reloadData];
          } failure:^(NSError *error) {
     [self.tableView headerEndRefreshing];
        
    }];


}

- (void)keybordDown {
    [self.view endEditing:YES];
    }

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  if (indexPath.row==0) {

 static NSString *cellid0 = @"cell0";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid0];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid0];
             UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, cell.contentView.height)];
    label.text = @"会议日期 :";
    
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
     _databutton = [UIButton buttonWithType:UIButtonTypeCustom];
      _databutton.frame = CGRectMake(label.right, label.top, 100, label.height);
      
    [_databutton setTitle:@"选择日期" forState:UIControlStateNormal];
      
          _databutton.titleLabel.font = [UIFont systemFontOfSize: 13.0];
     [_databutton setTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
     [_databutton addTarget:self action:@selector(dataaction) forControlEvents:UIControlEventTouchUpInside];
     _databutton.layer.borderColor = [[UIColor blackColor] CGColor];
       [cell.contentView addSubview:_databutton];
      
      _selectview = [selectview checkBoxFootView];
      _selectview.frame = CGRectMake(_databutton.right, label.top, 150, label.height);
       [cell.contentView addSubview:_selectview];
 
      }
             return cell;
}
else if(indexPath.row == 1){
 static NSString *cellid1 = @"cell1";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid1];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid1];      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 80, cell.contentView.height)];
    label.text = @"会议时间 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 _button1 = [UIButton buttonWithType:UIButtonTypeCustom];
      _button1.frame = CGRectMake(label.right, label.top, 110, label.height);
      [_button1 setTitle:@"开始时间" forState:UIControlStateNormal];
    _button1.titleLabel.font = [UIFont systemFontOfSize: 13.0];
     _button1.layer.borderColor = [[UIColor blackColor] CGColor];
       _button2 = [UIButton buttonWithType:UIButtonTypeCustom];
       _button2.layer.borderColor = [[UIColor blackColor] CGColor];
      _button2.frame = CGRectMake(_button1.right, label.top, 120, label.height);
      [_button2 setTitle:@"结束时间" forState:UIControlStateNormal];
          _button2.titleLabel.font = [UIFont systemFontOfSize: 13.0];
      [_button1 setTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
      [_button2 setTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
      [_button1 addTarget:self action:@selector(action1) forControlEvents:UIControlEventTouchUpInside];
[_button2 addTarget:self action:@selector(action2) forControlEvents:UIControlEventTouchUpInside];
       [cell.contentView addSubview:_button1];
       [cell.contentView addSubview:_button2];
       }
             return cell;



}
else if(indexPath.row ==2){
static NSString *cellid2 = @"cell2";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid2];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid2];
   UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, cell.contentView.height)];
    label.text = @"会议名称 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
      _workField = [[UITextView alloc]init];
           _workField.layer.borderColor = [[UIColor blackColor] CGColor];
      _workField.frame = CGRectMake(label.right, label.top+10, KScreenWidth-120, cell.height-10);
      UIColor *myColor = [UIColor colorWithWhite:0.5 alpha:0.2];
      _workField.backgroundColor = myColor;
 [_workField setFont:[UIFont systemFontOfSize:12]];
      _workField.delegate = self;
       [cell.contentView addSubview:_workField];}
             return cell;





}
else if(indexPath.row ==3){
 static NSString *cellid3 = @"cell3";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid3];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid3];
      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, cell.contentView.height)];
    label.text = @"申请日期 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    _databutton2 = [UIButton buttonWithType:UIButtonTypeCustom];
      _databutton2.frame =CGRectMake(label.right, label.top+10, KScreenWidth-120, cell.height-10);
      
          _databutton2.titleLabel.font = [UIFont systemFontOfSize: 13.0];
     [_databutton2 setTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
     [_databutton2 addTarget:self action:@selector(dataaction1) forControlEvents:UIControlEventTouchUpInside];
     _databutton2.layer.borderColor = [[UIColor blackColor] CGColor];
       [cell.contentView addSubview:_databutton2];
  
    
    
            }
                [_databutton2 setTitle:_date forState:UIControlStateNormal];

//             _shenqingField.text =_date;

             return cell;





}

else if(indexPath.row ==4){

 static NSString *cellid4 = @"cell4";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid4];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid4];      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 80, cell.contentView.height)];
    label.text = @"会议地点 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 _placebutton = [UIButton buttonWithType:UIButtonTypeCustom];
        _placebutton.layer.borderColor = [[UIColor blackColor] CGColor];
      _placebutton.frame = CGRectMake(label.right, label.top, 120, label.height);
//    _button1.backgroundColor = [UIColor yellowColor];
      [_placebutton setTitle:@"选择地点" forState:UIControlStateNormal];
    _placebutton.titleLabel.font = [UIFont systemFontOfSize: 13.0];
    
                 [_placebutton setTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
           [_placebutton addTarget:self action:@selector(placeaction) forControlEvents:UIControlEventTouchUpInside];

 
       [cell.contentView addSubview:_placebutton];}
             return cell;



}
else if(indexPath.row ==5){
static NSString *cellid5 = @"cell5";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid5];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid5];      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, cell.contentView.height)];
    label.text = @"主持人 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
      _peopleField = [[UITextView alloc]init];
           _peopleField.layer.borderColor = [[UIColor blackColor] CGColor];
      _peopleField.frame = CGRectMake(label.right, label.top+10, KScreenWidth-120, cell.height-10);
      UIColor *myColor = [UIColor colorWithWhite:0.5 alpha:0.2];
      _peopleField.backgroundColor = myColor;
 [_peopleField setFont:[UIFont systemFontOfSize:12]];
      _peopleField.delegate = self;
       [cell.contentView addSubview:_peopleField];}
             return cell;



}
else if(indexPath.row ==6){
static NSString *cellid6 = @"cell6";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid6];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid6];
      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, cell.contentView.height)];
    label.text = @"人数 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
            _dayField = [[UITextView alloc]init];
      _dayField.frame = CGRectMake(label.right, label.top+5, 40, cell.height-10);
_dayField.keyboardType = UIKeyboardTypeDecimalPad;
     [_dayField setFont:[UIFont systemFontOfSize:14]];

       UIColor *myColor = [UIColor colorWithWhite:0.5 alpha:0.2];

      _dayField.backgroundColor = myColor;
      _dayField.delegate = self;
    
       UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(_dayField.right, 0, 30, cell.contentView.height)];
    label2.text = @"人";
    label2.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label2];

       [cell.contentView addSubview:_dayField];}
             return cell;




}
else if (indexPath.row == 7){
static NSString *cellid7 = @"cell7";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid7];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid7];      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, cell.contentView.height)];
    label.text = @"承办处室(单位):";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
      _danweiField = [[UITextView alloc]init];
           _danweiField.layer.borderColor = [[UIColor blackColor] CGColor];
      _danweiField.frame = CGRectMake(label.right, label.top+10, KScreenWidth-120, cell.height-10);
      UIColor *myColor = [UIColor colorWithWhite:0.5 alpha:0.2];
      _danweiField.backgroundColor = myColor;
 [_danweiField setFont:[UIFont systemFontOfSize:12]];
      _danweiField.delegate = self;
       [cell.contentView addSubview:_danweiField];}
             return cell;



}
else if (indexPath.row == 8){
static NSString *cellid8 = @"cell8";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid8];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid8];
      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, cell.contentView.height)];
    label.text = @"承办联系人 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
      _lianxiField = [[UITextView alloc]init];
           _lianxiField.layer.borderColor = [[UIColor blackColor] CGColor];
      _lianxiField.frame = CGRectMake(label.right, label.top+10, KScreenWidth-120, cell.height-10);
      UIColor *myColor = [UIColor colorWithWhite:0.5 alpha:0.2];
      _lianxiField.backgroundColor = myColor;
 [_lianxiField setFont:[UIFont systemFontOfSize:12]];
      _lianxiField.delegate = self;
       [cell.contentView addSubview:_lianxiField];}
             return cell;



}
else if (indexPath.row == 9){
static NSString *cellid9 = @"cell9";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid9];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid9];        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, cell.contentView.height)];
    label.text = @"联系电话 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
      _phoneField = [[UITextView alloc]init];
           _phoneField.layer.borderColor = [[UIColor blackColor] CGColor];
      _phoneField.frame = CGRectMake(label.right, label.top+10, KScreenWidth-120, cell.height-10);
      UIColor *myColor = [UIColor colorWithWhite:0.5 alpha:0.2];
      _phoneField.backgroundColor = myColor;
 [_phoneField setFont:[UIFont systemFontOfSize:12]];
      _phoneField.delegate = self;
       [cell.contentView addSubview:_phoneField];}
             return cell;



}
else {
static NSString *cellid10 = @"cell10";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellid10];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid10];
      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, 40)];
    label.text = @"备注 :";
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
      _beizhuField = [[UITextView alloc]init];
           _beizhuField.layer.borderColor = [[UIColor blackColor] CGColor];
      _beizhuField.frame = CGRectMake(10, label.bottom, KScreenWidth-20, 100);
      UIColor *myColor = [UIColor colorWithWhite:0.5 alpha:0.2];
      _beizhuField.backgroundColor = myColor;
 [_beizhuField setFont:[UIFont systemFontOfSize:12]];
      _beizhuField.delegate = self;
       [cell.contentView addSubview:_beizhuField];}
             return cell;



}


}
//pickerchicoe选择器 
- (void)placeaction{
PickerChoiceView *picker = [[PickerChoiceView alloc]initWithFrame:self.view.bounds];
    picker.delegate = self;
           picker.selectLb.text = @"地点选择";
        picker.customArr = _array;
    

    [self.view addSubview:picker];




}
- (void)PickerSelectorIndixString:(NSString *)str{


[_placebutton setTitle:str forState:UIControlStateNormal];
_placestring = str;
}
//日期选择
- (void)dataaction{
 _selectDatePicker = [[MHDatePicker alloc] init];
    _selectDatePicker.isBeforeTime = YES;
    _selectDatePicker.datePickerMode = UIDatePickerModeDate;
    
    __weak typeof(self) weakSelf = self;
    [_selectDatePicker didFinishSelectedDate:^(NSDate *selectedDate) {
      NSString *string = [weakSelf dateStringWithDate:selectedDate DateFormat:@"yyyy-MM-dd"];
      _datestring = string;
      [weakSelf.databutton setTitle:string forState:UIControlStateNormal];
    }];

}


- (void)dataaction1{
 _selectDatePicker2 = [[MHDatePicker alloc] init];
    _selectDatePicker2.isBeforeTime = YES;
    _selectDatePicker2.datePickerMode = UIDatePickerModeDate;
    
    __weak typeof(self) weakSelf = self;
    [_selectDatePicker2 didFinishSelectedDate:^(NSDate *selectedDate) {
      NSString *string = [weakSelf dateStringWithDate:selectedDate DateFormat:@"yyyy-MM-dd"];
      _date = string;
      [weakSelf.databutton2 setTitle:_date forState:UIControlStateNormal];
    }];

}


- (NSString *)dateStringWithDate:(NSDate *)date DateFormat:(NSString *)dateFormat
{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:dateFormat];
    [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]];
    NSString *str = [dateFormatter stringFromDate:date];
    return str ? str : @"";
}
// 选择时间
- (void)action1{
  _button1.selected = !_button1.selected;
_type = @"1";
    _customPicker.hiddenCustomPicker = !_button1.selected;


}
- (void)action2{
_button2.selected = !_button2.selected;
_type = @"2";
    _customPicker.hiddenCustomPicker = !_button2.selected;
}
#pragma mark -- CustomDatePicker delegate
- (void)returnDateStrWithDateStr:(NSString *)dateStr {
if ([_type isEqualToString:@"1"]) {
_startime = dateStr;
    [_button1 setTitle:dateStr forState:UIControlStateNormal];
}else{
_endtime = dateStr;
   [_button2 setTitle:[NSString stringWithFormat:@"至%@",dateStr] forState:UIControlStateNormal];

}
  
}


-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 10)
{
return 140;
}else{
return 50;
}
    
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 11;
}

@end
